package testFestival;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import player.Player;
import festival.*;
public class testFestival {

	@Before
	public void setUp() throws Exception {
	}

	@Test
	public void testUpdatePos1SEPoints() { // test +1
		Player ken = new Player();
		
		int beforeFestival = ken.getSEPoint();
				
		festivalController fC = new festivalController();
		
		// Add 1 SE point to user
		// the update is a void method
		fC.updateSEPoints(ken, 1);
		
		int afterfestival = fC.gettemPlayer().getSEPoint();
		
		int expectedResult = beforeFestival+1;
		
		assertEquals(expectedResult, afterfestival );
	}
	
	@Test
	public void testUpdateNev1SEPoints() { // test -1
		Player ken = new Player();
		
		int beforeFestival = ken.getSEPoint();
				
		festivalController fC = new festivalController();
		
		// Minus 1 SE point to user
		// the update is a void method
		fC.updateSEPoints(ken, -1);
		
		int afterfestival = fC.gettemPlayer().getSEPoint();
		
		int expectedResult = beforeFestival-1;
		
		assertEquals(expectedResult, afterfestival );
	}

}
